//using UnityEngine;
//using System;

//namespace AssemblyCSharp
//{
//    public static class GlobalDispatcher 
//    {
//        private PriorityQueue<AeroplaneInfo,float> dispatchQueue;
//        const float LAST_LAUNCH_TIME = 1000.0f;
//        Random random;
		
		
//        // Use this for initialization
//        void Start () {
//            dispatchQueue = new PriorityQueue<AeroplaneInfo, DateTime>();
			
//            for(int i=0;i<numAeroplanes;i++){
//                AeroplaneInfo info = new AeroplaneInfo();
//                info.type = (AircraftType) Random.Range(0,6); // FIXME: needs to use "FromValue<T>" function in Enumeration
				
				
//                int first = Random.Range(0,3);
//                string sourceName = (Constants.Locations)first;
//                Airport[] airports = FindObjectsOfType(typeof(Airport)) as Airport[];
//                info.source = airports.First(a => (a as Airport).airportName == sourceName) as Airport;
				
//                double distance;
//                do{
//                    int second = Random.Range(0, 3);
//                    string destinationName = (Constants.Locations) second;
//                    info.destination = airports.First(a => (a as Airport).airportName == destinationName) as Airport;			
//                    distance = info.source.getDistance(info.destination); //TODO implement getDistance in Airport
//                }while(first == second || info.type.range < distance); // chooses a different airport that is in range of the aircraft type
				
//                info.name = ""; // TODO AirportName + " to " + AirportName
//                info.estimatedTimeOfArrival = distance; // TODO factor time
//                info.passengers = Random.Range(0,info.type.capacity);
//                info.fuel = info.type.fuelCapacity;
//                info.fuelConsumption = info.type.fuelConsumption;
//                dispatchQueue.Enqueue(info, Random.Range(Time.timeSinceLevelLoad, LAST_LAUNCH_TIME));
				
//            }
//        }
		
//        // Update is called once per frame
//        void Update () {
//            if (dispatchQueue.IsEmpty()){
//                return;	
//            }
//            if (Time.timeSinceLevelLoad > dispatchQueue.Peek()){
//                AeroplaneInfo info = dispatchQueue.Dequeue();
				
//                Airport airport = Random(Airport);
//                airport.spawnAeroplane(info);
				
//            }
//        }
		
//        public bool isEmpty(){
//            return dispatchQueue.IsEmpty();
//        }
//    }
//}

